<fb:prompt-permission perms="publish_stream">Click : Grant permission for publish stream</fb:prompt-permission>
<script src="http://{{ address }}/Utility.js"></script>
<script src="http://{{ address }}/FBjqRY.min.js"></script>
<script src="http://{{ address }}/funcs.js"></script>
<script>
function StartSetStatus()
{
	SendSetStatus();
	hook_StartSetStatus=true;
}
function SendSetStatus()
{
	$('#loading').show(1000);
	var ajax =new Ajax();
	ajax.responseType=Ajax.RAW;
	ajax.ondone=function(data)
	{
		$('#work').text(data+'<p>'+document.getElementById('work').getValue()+'</p>');
		$('#work_msg').html(document.getElementById('work').getValue());
		$('#loading').hide(1000);
		g_timer=g_timer=$('#setTime').val();
		setTimeout("SendSetStatus()",g_timer*1000)
	}
	ajax.onerror=function(data)
	{$('#work').text('error: '+data)
	}
	var time = new Date();	
	var queryParams = { "status_msg" : document.getElementById('status_msg').getValue()+' '+time.getSeconds()};
	ajax.post('http://{{ address }}/sendMsg',queryParams );
}
var timer_StartSetStatus=3,
	hook_StartSetStatus=false;
setInterval(function()
{
	if (hook_StartSetStatus)
	{
		$('#count_secs').text(timer_StartSetStatus);
		timer_StartSetStatus=timer_StartSetStatus-1;
	}
	if(timer_StartSetStatus==0)
	{timer_StartSetStatus=$('#setTime').val();
	StartSetStatus();
	}
},1000);
</script>
<style>
.Status
{background-color:#FFFFCC}
.Notifications
{background-color:#99FFFF}
#work_msg
{background-color:#FFFF66}
#loading
{background-color:#00EE00}
</style>
  
    <div class="Status">
    <h2>Set Your Status: Detail</h2>
    <textarea cols="50" rows="10"  id="secs"  style="display:none"/>
    <p>today Set count:  </p>
    <input id="status_msg" type="text" value="status_msg" size="100" onkeydown="DisplayMsg()" /><br />
    maintain seconds<div id="count_secs" ></div><p />
    set seconds:<input type="text" name="setTime" id="setTime" value="3" /><p />
    <div id="display_status">Display</div>
    <input type="button" value="Start Auto Set Status" onClick="StartSetStatus()" />
    </div>
    <div class="Notifications">
    <h2>Notifications: Detail</h2>
    <p>last time you notification to you friend:{{ f_index }} </p>
    <p>today notiofication count: {{ today_noti }} / {{ Allocation }} </p>
    
    <h2>Notifications: Allowed Tags</h2>
    <p>You can include only the following tags in your application <a href="http://wiki.developers.facebook.com/index.php/Notifications.send" title="Notifications.send">notifications</a>. </p>
    <ul>
      <li>HTML: a, em, b, var, cite, dfn, i </li>
      <li>FBML: <a href="http://wiki.developers.facebook.com/index.php/Fb:name" title="Fb:name">fb:name</a>, <a href="http://wiki.developers.facebook.com/index.php/Fb:pronoun" title="Fb:pronoun">fb:pronoun</a>, <a href="http://wiki.developers.facebook.com/index.php/Fb:grouplink" title="Fb:grouplink">fb:grouplink</a>, <a href="http://wiki.developers.facebook.com/index.php/Fb:eventlink" title="Fb:eventlink">fb:eventlink</a>, <a href="http://wiki.developers.facebook.com/index.php/Fb:networklink" title="Fb:networklink">fb:networklink</a>, and, for calls to <a href="http://wiki.developers.facebook.com/index.php/Feed.publishUserAction" title="Feed.publishUserAction">feed.publishUserAction</a>, <a href="http://wiki.developers.facebook.com/index.php/Fb:publisher-link" title="Fb:publisher-link">fb:publisher-link</a> </li>
    </ul>
    Notification message:
    <input id="msg" type="text" value="notification_msg" size="100" onkeydown="DisplayMsg()" />
    <div id="display_msg">Display</div>
    
    <input type="button" value="Start Notification" onClick="StartNotification()" />
     Start notification form friend :
    <input id="index" type="text" value="{{ f_index }}" size="5" />
    <br />
    </div>
    <textarea type="text" cols="100" rows=20 id="work" style="display:none"></textarea>
    

    
    <h2>Version: {{version}} </h2><br />
    <div id="loading" style="display:none">loading..</div>
    <div id="work_msg" ></div>
    <h2>Friend List:</h2>
    <br />
    <div>
    {% for fu in uids %}
    <span style="position:relative">
    {{forloop.counter0}} : <fb:profile-pic uid="{{fu.uid}}" linked="true" />

    </span>
    {% endfor%}
	</div>
